3.4.4 \(\int (g+h x) (A+B \log (e (a+b x)^n (c+d x)^{-n}))^2 \, dx\) [304]

3.4.4.1 Optimal result
3.4.4.2 Mathematica [A] (verified)
3.4.4.3 Rubi [A] (warning: unable to verify)
3.4.4.4 Maple [F(-1)]
3.4.4.5 Fricas [F]
3.4.4.6 Sympy [F(-2)]
3.4.4.7 Maxima [B] (verification not implemented)
3.4.4.8 Giac [F]
3.4.4.9 Mupad [F(-1)]

3.4.4.1 Optimal result

Integrand size = 31, antiderivative size = 294 \[ \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\frac {B^2 (b c-a d)^2 h n^2 \log (c+d x)}{b^2 d^2}-\frac {B (b c-a d) h n (a+b x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{b^2 d}+\frac {B (b c-a d) (2 b d g-b c h-a d h) n \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{b^2 d^2}-\frac {(b g-a h)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{2 b^2 h}+\frac {(g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{2 h}+\frac {B^2 (b c-a d) (2 b d g-b c h-a d h) n^2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{b^2 d^2} \]

output
B^2*(-a*d+b*c)^2*h*n^2*ln(d*x+c)/b^2/d^2-B*(-a*d+b*c)*h*n*(b*x+a)*(A+B*ln( 
e*(b*x+a)^n/((d*x+c)^n)))/b^2/d+B*(-a*d+b*c)*(-a*d*h-b*c*h+2*b*d*g)*n*ln(( 
-a*d+b*c)/b/(d*x+c))*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))/b^2/d^2-1/2*(-a*h+b 
*g)^2*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2/b^2/h+1/2*(h*x+g)^2*(A+B*ln(e*(b 
*x+a)^n/((d*x+c)^n)))^2/h+B^2*(-a*d+b*c)*(-a*d*h-b*c*h+2*b*d*g)*n^2*polylo 
g(2,d*(b*x+a)/b/(d*x+c))/b^2/d^2
 
3.4.4.2 Mathematica [A] (verified)

Time = 0.58 (sec) , antiderivative size = 472, normalized size of antiderivative = 1.61 \[ \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\frac {a B^2 d^2 (-2 b g+a h) n^2 \log ^2(a+b x)-2 B n \log (a+b x) \left (b^2 B c (-2 d g+c h) n \log (c+d x)-B (b c-a d) (-2 b d g+b c h+a d h) n \log \left (\frac {b (c+d x)}{b c-a d}\right )+a d \left (A (-2 b d g+a d h)+B (-2 b d g+b c h-a d h) n+B d (-2 b g+a h) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right )+b \left (b B^2 c (-2 d g+c h) n^2 \log ^2(c+d x)+2 B n \log (c+d x) \left (A b c (-2 d g+c h)+B \left (b c^2 h-a d (2 d g+c h)\right ) n+b B c (-2 d g+c h) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )+d \left (A b x (2 A d g-2 B c h n+A d h x)+2 a B n (-2 A d g-2 B d g n+B c h n+A d h x)+2 B (a B d n (-2 g+h x)+b x (2 A d g-B c h n+A d h x)) \log \left (e (a+b x)^n (c+d x)^{-n}\right )+b B^2 d x (2 g+h x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )\right )\right )+2 B^2 (b c-a d) (-2 b d g+b c h+a d h) n^2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )}{2 b^2 d^2} \]

input
Integrate[(g + h*x)*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2,x]
 
output
(a*B^2*d^2*(-2*b*g + a*h)*n^2*Log[a + b*x]^2 - 2*B*n*Log[a + b*x]*(b^2*B*c 
*(-2*d*g + c*h)*n*Log[c + d*x] - B*(b*c - a*d)*(-2*b*d*g + b*c*h + a*d*h)* 
n*Log[(b*(c + d*x))/(b*c - a*d)] + a*d*(A*(-2*b*d*g + a*d*h) + B*(-2*b*d*g 
 + b*c*h - a*d*h)*n + B*d*(-2*b*g + a*h)*Log[(e*(a + b*x)^n)/(c + d*x)^n]) 
) + b*(b*B^2*c*(-2*d*g + c*h)*n^2*Log[c + d*x]^2 + 2*B*n*Log[c + d*x]*(A*b 
*c*(-2*d*g + c*h) + B*(b*c^2*h - a*d*(2*d*g + c*h))*n + b*B*c*(-2*d*g + c* 
h)*Log[(e*(a + b*x)^n)/(c + d*x)^n]) + d*(A*b*x*(2*A*d*g - 2*B*c*h*n + A*d 
*h*x) + 2*a*B*n*(-2*A*d*g - 2*B*d*g*n + B*c*h*n + A*d*h*x) + 2*B*(a*B*d*n* 
(-2*g + h*x) + b*x*(2*A*d*g - B*c*h*n + A*d*h*x))*Log[(e*(a + b*x)^n)/(c + 
 d*x)^n] + b*B^2*d*x*(2*g + h*x)*Log[(e*(a + b*x)^n)/(c + d*x)^n]^2)) + 2* 
B^2*(b*c - a*d)*(-2*b*d*g + b*c*h + a*d*h)*n^2*PolyLog[2, (d*(a + b*x))/(- 
(b*c) + a*d)])/(2*b^2*d^2)
 
3.4.4.3 Rubi [A] (warning: unable to verify)

Time = 0.86 (sec) , antiderivative size = 410, normalized size of antiderivative = 1.39, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {2973, 2953, 2798, 2804, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (g+h x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2 \, dx\)

\(\Big \downarrow \) 2973

\(\displaystyle \int (g+h x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2dx\)

\(\Big \downarrow \) 2953

\(\displaystyle (b c-a d) \int \frac {\left (b g-a h-\frac {(d g-c h) (a+b x)}{c+d x}\right ) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{\left (b-\frac {d (a+b x)}{c+d x}\right )^3}d\frac {a+b x}{c+d x}\)

\(\Big \downarrow \) 2798

\(\displaystyle (b c-a d) \left (\frac {\left (-\frac {(a+b x) (d g-c h)}{c+d x}-a h+b g\right )^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{2 h (b c-a d) \left (b-\frac {d (a+b x)}{c+d x}\right )^2}-\frac {B n \int \frac {(c+d x) \left (b g-a h-\frac {(d g-c h) (a+b x)}{c+d x}\right )^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{(a+b x) \left (b-\frac {d (a+b x)}{c+d x}\right )^2}d\frac {a+b x}{c+d x}}{h (b c-a d)}\right )\)

\(\Big \downarrow \) 2804

\(\displaystyle (b c-a d) \left (\frac {\left (-\frac {(a+b x) (d g-c h)}{c+d x}-a h+b g\right )^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{2 h (b c-a d) \left (b-\frac {d (a+b x)}{c+d x}\right )^2}-\frac {B n \int \left (\frac {(b c-a d)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) h^2}{b d \left (b-\frac {d (a+b x)}{c+d x}\right )^2}+\frac {(b c-a d) (2 b d g-b c h-a d h) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) h}{b^2 d \left (b-\frac {d (a+b x)}{c+d x}\right )}+\frac {(b g-a h)^2 (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{b^2 (a+b x)}\right )d\frac {a+b x}{c+d x}}{h (b c-a d)}\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle (b c-a d) \left (\frac {\left (-\frac {(a+b x) (d g-c h)}{c+d x}-a h+b g\right )^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{2 h (b c-a d) \left (b-\frac {d (a+b x)}{c+d x}\right )^2}-\frac {B n \left (-\frac {h (b c-a d) (-a d h-b c h+2 b d g) \log \left (1-\frac {d (a+b x)}{b (c+d x)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{b^2 d^2}+\frac {(b g-a h)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{2 b^2 B n}+\frac {h^2 (a+b x) (b c-a d)^2 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{b^2 d (c+d x) \left (b-\frac {d (a+b x)}{c+d x}\right )}-\frac {B h n (b c-a d) (-a d h-b c h+2 b d g) \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{b^2 d^2}+\frac {B h^2 n (b c-a d)^2 \log \left (b-\frac {d (a+b x)}{c+d x}\right )}{b^2 d^2}\right )}{h (b c-a d)}\right )\)

input
Int[(g + h*x)*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2,x]
 
output
(b*c - a*d)*(((b*g - a*h - ((d*g - c*h)*(a + b*x))/(c + d*x))^2*(A + B*Log 
[e*((a + b*x)/(c + d*x))^n])^2)/(2*(b*c - a*d)*h*(b - (d*(a + b*x))/(c + d 
*x))^2) - (B*n*(((b*c - a*d)^2*h^2*(a + b*x)*(A + B*Log[e*((a + b*x)/(c + 
d*x))^n]))/(b^2*d*(c + d*x)*(b - (d*(a + b*x))/(c + d*x))) + ((b*g - a*h)^ 
2*(A + B*Log[e*((a + b*x)/(c + d*x))^n])^2)/(2*b^2*B*n) + (B*(b*c - a*d)^2 
*h^2*n*Log[b - (d*(a + b*x))/(c + d*x)])/(b^2*d^2) - ((b*c - a*d)*h*(2*b*d 
*g - b*c*h - a*d*h)*(A + B*Log[e*((a + b*x)/(c + d*x))^n])*Log[1 - (d*(a + 
 b*x))/(b*(c + d*x))])/(b^2*d^2) - (B*(b*c - a*d)*h*(2*b*d*g - b*c*h - a*d 
*h)*n*PolyLog[2, (d*(a + b*x))/(b*(c + d*x))])/(b^2*d^2)))/((b*c - a*d)*h) 
)
 

3.4.4.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2798
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_))^(q_)*(( 
f_) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(f + g*x)^(m + 1)*(d + e*x)^(q + 
 1)*((a + b*Log[c*x^n])^p/((q + 1)*(e*f - d*g))), x] - Simp[b*n*(p/((q + 1) 
*(e*f - d*g)))   Int[(f + g*x)^(m + 1)*(d + e*x)^(q + 1)*((a + b*Log[c*x^n] 
)^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, q}, x] && NeQ[e*f 
 - d*g, 0] && EqQ[m + q + 2, 0] && IGtQ[p, 0] && LtQ[q, -1]
 

rule 2804
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{ 
u = ExpandIntegrand[(a + b*Log[c*x^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] / 
; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]
 

rule 2953
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*( 
B_.))^(p_.)*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(b*c - a*d)   Sub 
st[Int[(b*f - a*g - (d*f - c*g)*x)^m*((A + B*Log[e*x^n])^p/(b - d*x)^(m + 2 
)), x], x, (a + b*x)/(c + d*x)], x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n} 
, x] && NeQ[b*c - a*d, 0] && IntegerQ[m] && IGtQ[p, 0]
 

rule 2973
Int[((A_.) + Log[(e_.)*(u_)^(n_.)*(v_)^(mn_)]*(B_.))^(p_.)*(w_.), x_Symbol] 
 :> Subst[Int[w*(A + B*Log[e*(u/v)^n])^p, x], e*(u/v)^n, e*(u^n/v^n)] /; Fr 
eeQ[{e, A, B, n, p}, x] && EqQ[n + mn, 0] && LinearQ[{u, v}, x] &&  !Intege 
rQ[n]
 
3.4.4.4 Maple [F(-1)]

Timed out.

hanged

input
int((h*x+g)*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2,x)
 
output
int((h*x+g)*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2,x)
 
3.4.4.5 Fricas [F]

\[ \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\int { {\left (h x + g\right )} {\left (B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2} \,d x } \]

input
integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="frica 
s")
 
output
integral(A^2*h*x + A^2*g + (B^2*h*x + B^2*g)*log((b*x + a)^n*e/(d*x + c)^n 
)^2 + 2*(A*B*h*x + A*B*g)*log((b*x + a)^n*e/(d*x + c)^n), x)
 
3.4.4.6 Sympy [F(-2)]

Exception generated. \[ \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\text {Exception raised: HeuristicGCDFailed} \]

input
integrate((h*x+g)*(A+B*ln(e*(b*x+a)**n/((d*x+c)**n)))**2,x)
 
output
Exception raised: HeuristicGCDFailed >> no luck
 
3.4.4.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 903 vs. \(2 (289) = 578\).

Time = 0.71 (sec) , antiderivative size = 903, normalized size of antiderivative = 3.07 \[ \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=A B h x^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {1}{2} \, A^{2} h x^{2} + 2 \, A B g x \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A^{2} g x + \frac {2 \, {\left (\frac {a e n \log \left (b x + a\right )}{b} - \frac {c e n \log \left (d x + c\right )}{d}\right )} A B g}{e} - \frac {{\left (\frac {a^{2} e n \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} e n \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c e n - a d e n\right )} x}{b d}\right )} A B h}{e} - \frac {{\left (a c d h n^{2} + {\left (2 \, c d g n \log \left (e\right ) - {\left (h n^{2} + h n \log \left (e\right )\right )} c^{2}\right )} b\right )} B^{2} \log \left (d x + c\right )}{b d^{2}} + \frac {{\left (2 \, a b d^{2} g n^{2} - a^{2} d^{2} h n^{2} - {\left (2 \, c d g n^{2} - c^{2} h n^{2}\right )} b^{2}\right )} {\left (\log \left (b x + a\right ) \log \left (\frac {b d x + a d}{b c - a d} + 1\right ) + {\rm Li}_2\left (-\frac {b d x + a d}{b c - a d}\right )\right )} B^{2}}{b^{2} d^{2}} + \frac {B^{2} b^{2} d^{2} h x^{2} \log \left (e\right )^{2} + 2 \, {\left (2 \, c d g n^{2} - c^{2} h n^{2}\right )} B^{2} b^{2} \log \left (b x + a\right ) \log \left (d x + c\right ) - {\left (2 \, c d g n^{2} - c^{2} h n^{2}\right )} B^{2} b^{2} \log \left (d x + c\right )^{2} - {\left (2 \, a b d^{2} g n^{2} - a^{2} d^{2} h n^{2}\right )} B^{2} \log \left (b x + a\right )^{2} + 2 \, {\left (a b d^{2} h n \log \left (e\right ) - {\left (c d h n \log \left (e\right ) - d^{2} g \log \left (e\right )^{2}\right )} b^{2}\right )} B^{2} x + 2 \, {\left ({\left (h n^{2} - h n \log \left (e\right )\right )} a^{2} d^{2} - {\left (c d h n^{2} - 2 \, d^{2} g n \log \left (e\right )\right )} a b\right )} B^{2} \log \left (b x + a\right ) + {\left (B^{2} b^{2} d^{2} h x^{2} + 2 \, B^{2} b^{2} d^{2} g x\right )} \log \left ({\left (b x + a\right )}^{n}\right )^{2} + {\left (B^{2} b^{2} d^{2} h x^{2} + 2 \, B^{2} b^{2} d^{2} g x\right )} \log \left ({\left (d x + c\right )}^{n}\right )^{2} + 2 \, {\left (B^{2} b^{2} d^{2} h x^{2} \log \left (e\right ) - {\left (2 \, c d g n - c^{2} h n\right )} B^{2} b^{2} \log \left (d x + c\right ) + {\left (a b d^{2} h n - {\left (c d h n - 2 \, d^{2} g \log \left (e\right )\right )} b^{2}\right )} B^{2} x + {\left (2 \, a b d^{2} g n - a^{2} d^{2} h n\right )} B^{2} \log \left (b x + a\right )\right )} \log \left ({\left (b x + a\right )}^{n}\right ) - 2 \, {\left (B^{2} b^{2} d^{2} h x^{2} \log \left (e\right ) - {\left (2 \, c d g n - c^{2} h n\right )} B^{2} b^{2} \log \left (d x + c\right ) + {\left (a b d^{2} h n - {\left (c d h n - 2 \, d^{2} g \log \left (e\right )\right )} b^{2}\right )} B^{2} x + {\left (2 \, a b d^{2} g n - a^{2} d^{2} h n\right )} B^{2} \log \left (b x + a\right ) + {\left (B^{2} b^{2} d^{2} h x^{2} + 2 \, B^{2} b^{2} d^{2} g x\right )} \log \left ({\left (b x + a\right )}^{n}\right )\right )} \log \left ({\left (d x + c\right )}^{n}\right )}{2 \, b^{2} d^{2}} \]

input
integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="maxim 
a")
 
output
A*B*h*x^2*log((b*x + a)^n*e/(d*x + c)^n) + 1/2*A^2*h*x^2 + 2*A*B*g*x*log(( 
b*x + a)^n*e/(d*x + c)^n) + A^2*g*x + 2*(a*e*n*log(b*x + a)/b - c*e*n*log( 
d*x + c)/d)*A*B*g/e - (a^2*e*n*log(b*x + a)/b^2 - c^2*e*n*log(d*x + c)/d^2 
 + (b*c*e*n - a*d*e*n)*x/(b*d))*A*B*h/e - (a*c*d*h*n^2 + (2*c*d*g*n*log(e) 
 - (h*n^2 + h*n*log(e))*c^2)*b)*B^2*log(d*x + c)/(b*d^2) + (2*a*b*d^2*g*n^ 
2 - a^2*d^2*h*n^2 - (2*c*d*g*n^2 - c^2*h*n^2)*b^2)*(log(b*x + a)*log((b*d* 
x + a*d)/(b*c - a*d) + 1) + dilog(-(b*d*x + a*d)/(b*c - a*d)))*B^2/(b^2*d^ 
2) + 1/2*(B^2*b^2*d^2*h*x^2*log(e)^2 + 2*(2*c*d*g*n^2 - c^2*h*n^2)*B^2*b^2 
*log(b*x + a)*log(d*x + c) - (2*c*d*g*n^2 - c^2*h*n^2)*B^2*b^2*log(d*x + c 
)^2 - (2*a*b*d^2*g*n^2 - a^2*d^2*h*n^2)*B^2*log(b*x + a)^2 + 2*(a*b*d^2*h* 
n*log(e) - (c*d*h*n*log(e) - d^2*g*log(e)^2)*b^2)*B^2*x + 2*((h*n^2 - h*n* 
log(e))*a^2*d^2 - (c*d*h*n^2 - 2*d^2*g*n*log(e))*a*b)*B^2*log(b*x + a) + ( 
B^2*b^2*d^2*h*x^2 + 2*B^2*b^2*d^2*g*x)*log((b*x + a)^n)^2 + (B^2*b^2*d^2*h 
*x^2 + 2*B^2*b^2*d^2*g*x)*log((d*x + c)^n)^2 + 2*(B^2*b^2*d^2*h*x^2*log(e) 
 - (2*c*d*g*n - c^2*h*n)*B^2*b^2*log(d*x + c) + (a*b*d^2*h*n - (c*d*h*n - 
2*d^2*g*log(e))*b^2)*B^2*x + (2*a*b*d^2*g*n - a^2*d^2*h*n)*B^2*log(b*x + a 
))*log((b*x + a)^n) - 2*(B^2*b^2*d^2*h*x^2*log(e) - (2*c*d*g*n - c^2*h*n)* 
B^2*b^2*log(d*x + c) + (a*b*d^2*h*n - (c*d*h*n - 2*d^2*g*log(e))*b^2)*B^2* 
x + (2*a*b*d^2*g*n - a^2*d^2*h*n)*B^2*log(b*x + a) + (B^2*b^2*d^2*h*x^2 + 
2*B^2*b^2*d^2*g*x)*log((b*x + a)^n))*log((d*x + c)^n))/(b^2*d^2)
 
3.4.4.8 Giac [F]

\[ \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\int { {\left (h x + g\right )} {\left (B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2} \,d x } \]

input
integrate((h*x+g)*(A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="giac" 
)
 
output
integrate((h*x + g)*(B*log((b*x + a)^n*e/(d*x + c)^n) + A)^2, x)
 
3.4.4.9 Mupad [F(-1)]

Timed out. \[ \int (g+h x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\int \left (g+h\,x\right )\,{\left (A+B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\right )}^2 \,d x \]

input
int((g + h*x)*(A + B*log((e*(a + b*x)^n)/(c + d*x)^n))^2,x)
 
output
int((g + h*x)*(A + B*log((e*(a + b*x)^n)/(c + d*x)^n))^2, x)